<?php
    $dropdown_data_region= array(
        'table_name'=>'animus_sub_region',
        'key_field'=>'id',
        'value_field'=>'name'
    );

    $dropdown_data_level= array(
        'table_name'=>'animus_anounce_level',
        'key_field'=>'id',
        'value_field'=>'name'
    );
?>
<div id="actu1" align="center">
        <div class="titre_home">Ajouter nouveau anonce</div>
<?php echo form_open_multipart('annonce/add_new_annonce');?>
    <table  class="list" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <label>Titre:</label>
                <p><textarea cols="60" rows="2" name="title" value="<?php echo set_value('title');?>"></textarea>
                <?php if(form_error('title')) echo form_error('title');?>
            </td>
        </tr>
        <tr>
            <td>
                <label >Image :</label>
                <p><input type="file" name="userfile" id="userfile" size="53"/></p>
            </td>
        </tr>
        <tr>
            <td>
                <label>Description:</label>
                <p><textarea rows="4" cols="60" name="description" size="30" value="<?php echo set_value('description');?>"></textarea></p>
                <?php if(form_error('description')) echo form_error('description');?>
            </td>
        </tr>
        <tr>
            <td>
                <label>Contenu :</label>
                <p>
                    <?php
                        $data = array(
                              'name' => 'content',
                              'id' => 'content',
                              'width' => '440',
                              'height' => '300'
                              );
                        echo form_fckeditor($data);
                    ?>
                </p>
                <?php if(form_error('content')) echo form_error('content');?>
            </td>
        </tr>
        <tr>
               <td>
                    <label>Sub-Region:</label>
                    <p><?php echo form_dropdown('sub_region',dropdown_data($dropdown_data_region),'01');?></p>
               </td>
        </tr>
        <tr>
               <td>
                    <label>Annonce Type:</label>
                    <p><?php echo form_dropdown('level',dropdown_data($dropdown_data_level),'1');?></p>
               </td>
        </tr>
       <tr>
           <td></td> <td><input type="submit" name="submit" id="submit" value = " Ajouter "/> </td>
        </tr>
    </table>
    <?php echo form_close();?>
</div>

